﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AgencyList.aspx.cs" Inherits="park.System_Agency.AgencyList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <script src="../load.js?callback=InitList&release=0" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="d_topbox" class="d_topbox">
        <div>
            <span>所属城区：</span>
            <select id="ddl_City" onchange="CitySelected()">
                <option value="-1">全部</option>
            </select>
            <script id="full_City" type="text/x-jquery-tmpl"><option value="${id}">${name}</option></script>
            <span>所属片区：</span>
            <select id="ddl_Area">
                <option value="-1">全部</option>
            </select>
            <script id="full_Area" type="text/x-jquery-tmpl"><option value="${id}">${name}</option></script>
            <span>名称：</span><input id="txtName" type="text" />
            <input id="btnSearch" type="button" value="查询" onclick="Search();" />
        </div>
    </div>
    <div id="table_box" class="table_box">
        <div>
            <input type="button" value="添加第一级机构" onclick="AddFirstAgency();" />
        </div>
        <table id="tb_list" width="90%" border="0" cellspacing="0" cellpadding="0">
            <tr class="td_title">
                <td align="left">
                    名称
                </td>
                <td align="center">
                    编码
                </td>
                <td align="center">
                    城区
                </td>
                <td align="center">
                    片区
                </td>
                <td align="center">
                    区域权限
                </td>
                <td align="center" style="width: 30%;">
                    操作
                </td>
            </tr>
        </table>
        <script id="tmpl_head" type="text/x-jquery-tmpl">
            <tr class="td_title">
                <td align="left">
                    名称
                </td>
                <td align="center">
                    编码
                </td>
                <td align="center">
                    城区
                </td>
                <td align="center">
                    片区
                </td>
                <td align="center">
                    区域权限
                </td>
                <td align="center" style="width: 30%;">
                    操作
                </td>
            </tr>
            <tr id="n-1">
                <td align="left">
                    机构
                </td>
                <td align="center">
                </td>
                <td align="center">
                </td>
                <td align="center">
                </td>
                <td align="center">
                </td>
                <td align="center">
                </td>
            </tr>
        </script>
        <script id="tmpl_list" type="text/x-jquery-tmpl">  
        <tr id="n{{= id }}" class="child-of-n{{= pid}}" style="background-color:{{= GetListItemBg() }}" pid="{{= pid}}" myid="{{= id}}">            
            <td align="left">{{= name}}</td>            
            <td align="center">${code}</td>
            <td align="center">{{= cName}}</td>
            <td align="center">${rName}</td>
            <td align="center">{{if hasAutority-0==1 }}有{{else}}无{{/if}}</td>
            <td align="center">
                <a href="javascript:AddAgency({{= id }},{{= pid }});">增加同级</a>&nbsp; 
                <a href="javascript:AddSubAgency({{= id }},{{= pid }});">增加下级</a>&nbsp; 
                <a href="javascript:Edit({{= id }});">修改</a>&nbsp; 
                <a href="javascript:Delete({{= id }});">删除</a>&nbsp;
                <a href="javascript:Up({{= id }},{{= pid }});">上移</a>&nbsp;
                <a href="javascript:Down({{= id }},{{= pid }});">下移</a>&nbsp;
                {{if hasAutority-0==1 }}
                <a href="javascript:SetAuthority({{= id }},{{= pid }},'{{= name}}','{{= code}}');">区域权限</a>&nbsp;
                {{/if}}
            </td>
        </tr>          
        </script>
    </div>
    </form>
</body>
</html>
